package com.ms.education.course.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * <p>
 * 课程
 * </p>
 *
 * @author ms
 * @since 2023-01-17
 */
@Getter
@Setter
@TableName("edu_course")
@ApiModel(value = "Course对象", description = "课程")
@ToString
public class Course implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("讲师id")
    @TableField("teacher_id")
    private Integer teacherId;

    @ApiModelProperty("讲师姓名")
    @TableField("teacher_name")
    private String teacherName;

    @ApiModelProperty("课程分类id")
    @TableField("subject_id")
    private Integer subjectId;

    @ApiModelProperty("课程分类父id")
    @TableField("subject_parent_id")
    private Integer subjectParentId;

    @ApiModelProperty("班级id，如果该课程是班级的，不能为空，只有加入班级才可见")
    @TableField("class_id")
    private Integer classId;

    @ApiModelProperty("课程标题")
    @TableField("title")
    private String title;

    @ApiModelProperty("价格")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty("总课时")
    @TableField("lesson_num")
    private Integer lessonNum;

    @ApiModelProperty("封面")
    @TableField("cover")
    private String cover;

    @ApiModelProperty("销售数量")
    @TableField("buy_count")
    private Long buyCount;

    @ApiModelProperty("浏览数量")
    @TableField("view_count")
    private Long viewCount;

    @ApiModelProperty("乐观锁")
    @TableField("version")
    @Version
    private Long version;

    @ApiModelProperty("课程状态 Draft未发布  Normal已发布")
    @TableField("status")
    private String status;

    @ApiModelProperty("逻辑删除 1（true）已删除， 0（false）未删除")
    @TableField("is_deleted")
    @TableLogic
    private Boolean isDeleted;

    @ApiModelProperty("创建时间")
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private Date gmtCreate;

    @ApiModelProperty("修改时间")
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @ApiModelProperty("课程描述")
    @TableField(exist = false)
    private String description;


}
